import requests
import re
import json
from urllib.parse import quote,unquote
# headers = {
#     'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36'
# }
# r = requests.get('http://image.baidu.com/search/acjson?tn=resultjson_com&ipn=rj&ct=201326592&is=&fp=result&queryWord=英雄联盟&cl=2&lm=-1&ie=utf-8&oe=utf-8&adpicid=&st=&z=&ic=&hd=&latest=&copyright=&word=英雄联盟&s=&se=&tab=&width=&height=&face=&istype=&qc=&nc=1&fr=&expermode=&force=&pn=30&rn=30&gsm=78&1550041444404=',headers=headers)
# r.encoding= 'utf-8'
# j = r.json()
# with open('j.json','w') as fp:
#     json.dump(j,fp)

print(unquote('http://image.baidu.com/search/down?tn=download&ipn=dwnl&word=download&ie=utf8&fr=result&url=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201510%2F28%2F20151028234935_dCmSL.jpeg&thumburl=http%3A%2F%2Fimg3.imgtn.bdimg.com%2Fit%2Fu%3D3189972887%2C1940566310%26fm%3D26%26gp%3D0.jpg'))
a = 'ippr_z2C$qAzdH3FAzdH3Fooo_z&e3B17tpwg2_z&e3Bv54AzdH3Fks52AzdH3F?t1=90ndabbmm'[4:]
b = 'ippr_z2C$qAzdH3FAzdH3Fk-ffs_z&e3B17tpwg2_z&e3Bv54AzdH3F7rs5w1fAzdH3Ftpj4AzdH3Fda8c8aAzdH3FdbAzdH3Fda8c8adbdn9lnc_1C4SL_z&e3B3rj2'[4:]
# 'http://i0.hdslb.com/bfs/article/b7ddc1ed44502d9d08c606255d84ed025cd93962.jpg'

def aaa(a):
    mapping_2 = {'w':"a",'k':"b",'v':"c",'1':"d",'j':"e",'u':"f",'2':"g",'i':"h",'t':"i",'3':"j",'h':"k",'s':"l",'4':"m",'g':"n",'5':"o",'r':"p",'q':"q",'6':"r",'f':"s",'p':"t",'7':"u",'e':"v",'o':"w",'8':"1",'d':"2",'n':"3",'9':"4",'c':"5",'m':"6",'0':"7",'b':"8",'l':"9",'a':"0"}
    mapping_1 = {'_z2C$q':":","_z&e3B":".",'AzdH3F':"/","ippr":"http"}
    for k,v in mapping_1.items():
        a = a.replace(k,v)
    a = a.lower()
    for i in range(len(a)):
        if i in mapping_2:
            a[i] = mapping_2[i]

    print(a)
aaa(a)
aaa(b)